package com.example.server.controller;

import com.example.nacos.api.HelloWordProxy;
import com.example.server.config.NacosConfigLocalCatch;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;

@RestController
public class HelloWordController implements HelloWordProxy {

    @Override
    public String feignPing() {
        return LocalDateTime.now().toString();
    }

    @Autowired
    private NacosConfigLocalCatch nacosConfigLocalCatch;

    @RequestMapping("/getText")
    public String getText() {
        return nacosConfigLocalCatch.get("testText", String.class);
    }
}
